﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Tool;

namespace AutoMachine
{
    public partial class Frm_AxisCfg : Form
    {
        Tool.AutoResize FormResize = new Tool.AutoResize();//窗体缩放实例化
        public Frm_AxisCfg()
        {
            InitializeComponent();
            FormResize.SetAutoResize(this);//窗体缩放实例化
        }

        private void Form3_Load(object sender, EventArgs e)
        {
            SystemCfg.ReadAxisCfgXmlToDGV(this.dgvAxisCfg);
        }

        private void 读取参数ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SystemCfg.ReadAxisCfgXmlToDGV(this.dgvAxisCfg);
        }

        private void 保存参数ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (Device.OperLevel != Device.OperationLevel.Developer)
            {
                MessageBox.Show("非开发人员,请勿操作");
                return;
            }
            SystemCfg.WriteAxisCfgDgvToXml(this.dgvAxisCfg);

        }

        private void 下载参数ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (Device.OperLevel != Device.OperationLevel.Developer)
            {
                MessageBox.Show("非开发人员,请勿操作");
                return;
            }
            SystemCfg.WriteAxisCfgXmlToSystem();
        }
    }
}
